home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
Borland Visual dBASE Professiona v7.0
/
DATA1.CAB
/
Sample_dBASE
/
Mugs
/
Inventory.WFM
< prev
next >
Wrap
Text File
|
1997-11-20
|
10KB
|
393 lines
//--------------------------------------------------------------
//
// Inventory.wfm - Mugs Sample Application
//
// Data entry from for Inventory table.
//
// Dependencies: MUGS.CFM
// MUGS.CC
// INVENTORY.DMD
//
// Visual dBASE Samples Group
//
// $Revision: 1.16 $
//
// Copyright (c) 1997, Borland International, Inc.
// All rights reserved.
//
//---------------------------------------------------------------
SET TALK OFF
** END HEADER -- do not remove this line
//
// Generated on 11/02/97
//
parameter bModal
local f
f = new inventoryForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class inventoryForm of MUGSDATACFORM from "MUGS.CFM"
with (this)
onOpen = {; this.book1.slidezoom.setFocus()}
onClose = class::FORM_ONCLOSE
open = class::FORM_OPEN
height = 18
left = 5
top = 1
width = 61
text = "Inventory - Data Entry"
endwith
this.DMINVENTORY = new DATAMODREF()
this.DMINVENTORY.parent = this
with (this.DMINVENTORY)
filename = "inventory.dmd"
dataModClass = "InventoryDataModule"
share = 0
active = true
left = 0
top = 0
endwith
with (this.BOOK1)
height = 16
left = 1
top = 2.5
width = 58.1429
metric = 0
fontName = "MS Sans Serif"
fontSize = 8
dataSource = 'ARRAY {"Inventory Item"}'
endwith
this.BOOK1.LABELID = new TEXT(this.BOOK1)
with (this.BOOK1.LABELID)
height = 1
left = 1
top = 2
width = 14
metric = 0
colorNormal = "BtnText"
alignVertical = 1
transparent = true
fontName = "MS Sans Serif"
fontSize = 8
text = "ID:"
endwith
this.BOOK1.ENTRYID = new ENTRYFIELD(this.BOOK1)
with (this.BOOK1.ENTRYID)
enabled = false
height = 1
left = 16
top = 2
width = 9
metric = 0
dataLink = parent.parent.DMINVENTORY.ref.inventory1.rowset.fields["Item ID"]
picture = "9999999"
colorHighLight = ""
fontName = "MS Sans Serif"
fontSize = 8
borderStyle = 7
endwith
this.BOOK1.LABELSUPPLIER = new TEXT(this.BOOK1)
with (this.BOOK1.LABELSUPPLIER)
height = 1
left = 1
top = 3.25
width = 14
metric = 0
colorNormal = "BtnText"
transparent = true
fontName = "MS Sans Serif"
fontSize = 8
text = "Supplier:"
endwith
this.BOOK1.COMBOSUPPLIER = new COMBOBOX(this.BOOK1)
with (this.BOOK1.COMBOSUPPLIER)
height = 1.0909
left = 16
top = 3.2727
width = 30
metric = 0
dataLink = parent.parent.DMINVENTORY.ref.inventory1.rowset.fields["Supplier ID"]
fontName = "MS Sans Serif"
fontSize = 8
style = 2
endwith
this.BOOK1.TOOLSUPPLIER = new PUSHBUTTON(this.BOOK1)
with (this.BOOK1.TOOLSUPPLIER)
onClick = class::TOOLSUPPLIER_ONCLICK
height = 1.2
left = 47
top = 3.2
width = 4
text = ""
metric = 0
upBitmap = "RESOURCE #148"
disabledBitmap = "RESOURCE #149"
fontSize = 8
group = true
colorNormal = "BtnText/BtnFace"
value = false
endwith
this.BOOK1.LABELDESCRIPT = new TEXT(this.BOOK1)
with (this.BOOK1.LABELDESCRIPT)
height = 1
left = 1
top = 4.75
width = 14
metric = 0
colorNormal = "BtnText"
transparent = true
fontName = "MS Sans Serif"
fontSize = 8
text = "Description:"
endwith
this.BOOK1.ENTRYDESCRIPTION = new ENTRYFIELD(this.BOOK1)
with (this.BOOK1.ENTRYDESCRIPTION)
height = 1
left = 16
top = 4.75
width = 30
metric = 0
dataLink = parent.parent.DMINVENTORY.ref.inventory1.rowset.fields["Description"]
colorHighLight = ""
fontName = "MS Sans Serif"
fontSize = 8
validRequired = true
borderStyle = 7
endwith
this.BOOK1.LABELLEVEL = new TEXT(this.BOOK1)
with (this.BOOK1.LABELLEVEL)
height = 1
left = 1
top = 6
width = 14
metric = 0
colorNormal = "BtnText"
transparent = true
fontName = "MS Sans Serif"
fontSize = 8
text = "Inventory level:"
endwith
this.BOOK1.SPINQTY = new SPINBOX(this.BOOK1)
with (this.BOOK1.SPINQTY)
height = 1
left = 16
top = 6
width = 10
metric = 0
dataLink = parent.parent.DMINVENTORY.ref.inventory1.rowset.fields["Qty"]
picture = "99999"
colorHighLight = ""
rangeMax = 100
rangeMin = 1
fontName = "MS Sans Serif"
fontSize = 8
validRequired = true
borderStyle = 7
endwith
this.BOOK1.RECTANGLE1 = new RECTANGLE(this.BOOK1)
with (this.BOOK1.RECTANGLE1)
left = 1
top = 7.25
width = 13
height = 5.75
metric = 0
text = "Picture"
colorNormal = "WindowText/BtnFace"
fontName = "MS Sans Serif"
fontSize = 8
endwith
this.BOOK1.SLIDEZOOM = new SLIDER(this.BOOK1)
with (this.BOOK1.SLIDEZOOM)
onChange = class::SLIDEZOOM_ONCHANGE
height = 1.5
left = 2
top = 8.5
width = 11
metric = 0
colorNormal = "BtnFace"
borderStyle = 4
value = 1
rangeMax = 3
rangeMin = 1
vertical = false
enableSelection = false
startSelection = -1
endSelection = -1
endwith
this.BOOK1.LABELZOOM = new TEXT(this.BOOK1)
with (this.BOOK1.LABELZOOM)
height = 1
left = 2
top = 10.1176
width = 11
metric = 0
colorNormal = "BtnText"
alignHorizontal = 1
transparent = true
fontName = "MS Sans Serif"
fontSize = 8
text = "Zoom"
endwith
this.BOOK1.BUTTONREPLACE = new PUSHBUTTON(this.BOOK1)
with (this.BOOK1.BUTTONREPLACE)
onClick = class::BUTTONREPLACE_ONCLICK
height = 1.2
left = 2
top = 11.2941
width = 11
text = "Replace"
metric = 0
fontName = "MS Sans Serif"
fontSize = 8
group = true
colorNormal = "BtnText/BtnFace"
value = false
endwith
this.BOOK1.IMAGEEMPTY = new IMAGE(this.BOOK1)
with (this.BOOK1.IMAGEEMPTY)
visible = false
height = 3.75
left = 16
top = 7.45
width = 12.5
metric = 0
dataSource = "FILE NOIMAGE.GIF"
alignment = 3
endwith
this.BOOK1.IMAGEMUG = new IMAGE(this.BOOK1)
with (this.BOOK1.IMAGEMUG)
height = 3.75
left = 16
top = 7.45
width = 12.5
metric = 0
dataSource = parent.parent.DMINVENTORY.ref.inventory1.rowset.fields["Picture"]
alignment = 3
endwith
this.rowset = this.DMINVENTORY.ref.inventory1.rowset
// {Linked Method} form.open
function Form_Open
this.book1.TOOLSUPPLIER.enabled := ( TYPE("this.app") == "O" )
this.book1.IMAGEEMPTY.visible := false
// add custom properties
this.book1.IMAGEMUG.baseWidth = this.book1.IMAGEMUG.width
this.book1.IMAGEMUG.baseHeight = this.book1.IMAGEMUG.height
this.rowset.form = this
with ( this.rowset )
onAppend := class::rowOnAppend
onNavigate := class::checkImage
endwith
this.title.text := "<h2>Inventory</h2>"
this.rowset.refreshControls()
return ( SUPER::FORM_OPEN() )
function rowOnAppend
local q
q = new Query()
with (q)
database := this.parent.database
sql := 'select supplier."Company" from supplier'
active := true
endwith
this.fields["Supplier ID"].value := q.rowset.fields[1].value
q.active := false
return true
// {Linked Method} form.onClose
function Form_onClose
this.rowset.form := null // remove extra reference
return ( this.rowset.form )
function checkImage
local bEmpty
bEmpty = true
if ( not this.endOfSet )
bEmpty := EMPTY( this.fields["Picture"].value )
endif
if ( this.form.book1.IMAGEMUG.visible == bEmpty )
this.form.book1.IMAGEMUG.visible := ( not bEmpty )
this.form.book1.IMAGEEMPTY.visible := ( bEmpty )
endif
return ( bEmpty )
// {Linked Method} form.book1.buttonreplace.onClick
function BUTTONREPLACE_onClick
local bResult, sImage, thisRow, iMug
bResult = false
sImage = GetFile("*.bmp","Replace Picture")
thisRow = this.form.rowset
iMug = this.form.book1.IMAGEMUG
if ( FILE(sImage) )
bResult := thisRow.fields["Picture"].replaceFromFile( sImage )
if ( iMug.dataSource <> thisRow.fields["Picture"] )
iMug.dataSource := thisRow.fields["Picture"]
endif
thisRow.refreshControls()
endif
return ( bResult )
// {Linked Method} form.book1.slidezoom.onChange
function SLIDEZOOM_onChange
local iMug
iMug = this.form.book1.imageMug
iMug.width := ( iMug.baseWidth * this.value )
iMug.height := ( iMug.baseHeight * this.value )
if ( this.form.height < iMug.top + iMug.height + 5 )
this.form.height := iMug.top + iMug.height + 5
endif
return ( this.setFocus() )
// {Linked Method} form.book1.toolsupplier.onClick
function TOOLSUPPLIER_onClick
local nID
nID = this.form.DMINVENTORY.Ref.supplier1.rowset.Fields["Supplier ID"].value
return ( this.form.app.openSupplierFormAsDialog( nID ) )
endclass